import time
from gpiozero import *

'''define pin conection in BCM number
Relay HAT    Raspberry Pi
      VCC   --->   3.3V
      GND   --->   GND
      CH1   --->   D6
      CH2   --->   D13
      CH3   --->   D19
      CH4   --->   D26
      CH5   --->   D12
      CH6   --->   D16
	  CH7   --->   D20
      CH8   --->   D21
'''
PIN_CH1     = 6
PIN_CH2     = 13
PIN_CH3     = 19
PIN_CH4     = 26
PIN_CH5     = 12
PIN_CH6     = 16
PIN_CH7     = 20
PIN_CH8     = 21


if __name__ == '__main__':
    CH1 = DigitalOutputDevice(PIN_CH1,active_high = True,initial_value =True)#
    CH2 = DigitalOutputDevice(PIN_CH2,active_high = True,initial_value =True)#
    CH3 = DigitalOutputDevice(PIN_CH3,active_high = True,initial_value =True)#
    CH4 = DigitalOutputDevice(PIN_CH4,active_high = True,initial_value =True)#
    CH5 = DigitalOutputDevice(PIN_CH5,active_high = True,initial_value =True)#
    CH6 = DigitalOutputDevice(PIN_CH6,active_high = True,initial_value =True)#
    CH7 = DigitalOutputDevice(PIN_CH7,active_high = True,initial_value =True)#
    CH8 = DigitalOutputDevice(PIN_CH8,active_high = True,initial_value =True)#
    while True:
        CH1.off() #NO close       
        time.sleep(1)
        CH1.on() #NC close
        CH2.off()#NO close 
        time.sleep(1)
        CH2.on() #NC close
        CH3.off()#NO close 
        time.sleep(1)
        CH3.on() #NC close        
        CH4.off() #NO close       
        time.sleep(1)
        CH4.on() #NC close
        CH5.off()#NO close 
        time.sleep(1)
        CH5.on() #NC close
        CH6.off()#NO close 
        time.sleep(1)
        CH6.on() #NC close
        CH7.off() #NO close       
        time.sleep(1)
        CH7.on() #NC close
        CH8.off()#NO close 
        time.sleep(1)
        CH8.on() #NC close


            
            
            
            
            
